import request from '@/utils/request'

class SupplierChannelModel {
  // 小店下拉
  static getStoresDrop() {
    return request<any, any>({
      url: '/store/all',
      method: 'POST'
    })
  }

  // 获取渠道列表
  static getSupplierChannelList(data: any) {
    return request<any, any>({
      url: '/channel/list',
      method: 'POST',
      data
    })
  }

  // 新增渠道
  static add(data: any) {
    return request<any, any>({
      url: '/channel',
      method: 'POST',
      data
    })
  }

  // 编辑
  static editById(id: number, data: any) {
    return request<any, any>({
      url: `/channel/${id}`,
      method: 'PUT',
      data
    })
  }

  // 删除
  static deleteById(id: number) {
    return request<any, any>({
      url: `/channel/${id}`,
      method: 'DELETE'
    })
  }

  // 获取详情
  static getDetail(id: number) {
    return request<any, any>({
      url: `/channel/${id}`,
      method: 'GET'
    })
  }
}

export default SupplierChannelModel
